package com.fitbet.api.dao;

import java.util.Date;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.fitbet.entity.bet.Bet;
import com.fitbet.entity.bet.BetStatus;
/**
 * 
 * @author sjh
 *
 */
@Dao("hibernate")
public interface BetDao {
	
	/**
	 * 
	 * @param dt 
	 * @return
	 */
	@Query("FROM Bet  WHERE startDate =:date")
	public Bet loadCurrentBet(@Variable("date") Date date);
	
	/**
     * 
     * @param time
     * @param betStatus
     * @return
     */
    @Query("FROM Bet WHERE status = :status AND disabled = false")
    public Bet loadCurrentBet(@Variable("status") BetStatus betStatus);
    
    /**
     * 
     * @param id
     * @param betStatus
     * @return
     */
    @Query("FROM Bet WHERE id = :id AND status = :status AND disabled = false")
    public Bet loadBet(@Variable("id") Long id, @Variable("status") BetStatus betStatus);
}
